﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AirLinq;
using System.Data.SqlClient;
using System.Reflection;
using AirLinqTest.LinqToSql;
using System.Data;

namespace AirLinqTest {
	class Program {
		static void Main(string[] args) {
			SqlConnection con = new SqlConnection("Server=server; Database=db1; User ID=user; Password=password");
			con.Open();
			var testContext = new TestDataContext(con);
			var q = testContext.Test.Select(c => new { T = c.N * 2, H = c.Name + "sdf" }).Select(c => new { T = c.T * 2 });
			//var t= q.OrderBy(c => c.gg+2).ThenBy(c => c.gg- 4);
			var context = new AirLinqDataContext(Assembly.GetExecutingAssembly().GetManifestResourceStream("AirLinqTest.ModelTest.xml"), con);
			var tbl=context.GetTable<ITestTable>();
			var tbl2 = tbl.Select(c => new { T = c.N * 2, H = c.Name+"sdf" }).Select(c=>new {T=c.T*2});
			foreach (var item in tbl) {
				var tst = item.N;

			}
		}
	}
}
